package client;

import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class LoginPanel extends JPanel {
	private JTextField textUserName;
	private JPasswordField textPassword;
	public LoginPanel() {
		setLayout(null);
		
		JLabel lblUserName = new JLabel("User Name");
		lblUserName.setBounds(98, 125, 92, 14);
		add(lblUserName);
		
		JLabel lblPassword = new JLabel("Password");
		lblPassword.setBounds(98, 154, 92, 14);
		add(lblPassword);
		
		textUserName = new JTextField();
		textUserName.setToolTipText("Enter your user name here (i.e. ID number)");
		textUserName.setBounds(200, 122, 86, 20);
		add(textUserName);
		textUserName.setColumns(10);
		
		textPassword = new JPasswordField();
		textPassword.setToolTipText("Enter your password here");
		textPassword.setEchoChar('*');
		textPassword.setBounds(200, 151, 86, 20);
		add(textPassword);
		
		JButton btnLogin = new JButton("Login");
		btnLogin.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				ClientWindow.cw.showsp();
			}
		});
		btnLogin.setBounds(98, 197, 89, 23);
		add(btnLogin);
		
		JButton btnExit = new JButton("Exit");
		btnExit.setToolTipText("Click To Exit");
		btnExit.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				System.exit(0);
			}
		});
		btnExit.setBounds(197, 197, 89, 23);
		add(btnExit);
	}
}
